package com.itszt.manager.dao;

import com.itszt.pojo.TbContent;
import com.itszt.pojo.TbContentCategory;
import com.itszt.taotao.pojo.TbContent;
import com.itszt.taotao.pojo.TbContentCategory;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface ContentDao {

    @Select("select * from tb_content_category where parent_id = #{parentID}")
    public List<TbContentCategory> queryCatsByParID(String parentID);

    @Insert("insert into tb_content values(null,#{categoryId},#{title},#{subTitle},#{titleDesc}," +
            "#{url},#{pic},#{pic2},#{content},#{created},#{updated})")
    public void insertContent(TbContent tbContent) throws Exception;

    @Select("select * from tb_content where category_id=#{cid}")
    public List<TbContent> queryContentByCid(String cid);
}
